﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.InteropServices;

namespace AdaptiveDeNet.DifferentialEvolution
{
    [StructLayout(LayoutKind.Explicit, Size = 256)]
    public class Member
    {

        [FieldOffset(0)]
        public double FEval;
        [FieldOffset(8)]
        public double[] Vector;

        /// <summary>
        /// Create new vector 
        /// </summary>
        /// <param name="dim">dimension</param>
        public Member(int dim)
        {
            Vector = new double[dim];
            FEval = double.NaN;
        }

        public Member()
        {

        }


        //#region Member members
        //private double[] vector;

        //public double[] Vector
        //{
        //    get { return vector; }
        //    set { vector = value; }
        //}

        //private double fEval;

        //public double FEval
        //{
        //    get { return fEval; }
        //    set { fEval = value; }
        //}

        //#endregion

    }
}
